<script>
	export default {
		globalData: {
			statusBarHeight: 20,
			windowWidth: 375,
			navBarHeight: 45
		},
		onLaunch: function() {
			const info = uni.getSystemInfoSync()
			this.globalData.statusBarHeight = info.statusBarHeight;
			this.globalData.windowWidth = info.windowWidth
			// 除了h5 app mp-alipay的情况下执行
			// #ifdef MP
			// 获取胶囊的位置
			const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
			console.log(menuButtonInfo);
			// (胶囊底部高度 - 状态栏的高度) + (胶囊顶部高度 - 状态栏内的高度) = 导航栏的高度
			this.globalData.navBarHeight = (menuButtonInfo.bottom - info.statusBarHeight) + (menuButtonInfo.top - info
				.statusBarHeight)
			console.log(menuButtonInfo)
			this.globalData.windowWidth = menuButtonInfo.left
			// #endif
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	/* 隐藏滚动条 */
	::-webkit-scrollbar {
	width: 0;
	height: 0;
	color: transparent;
	}
</style>
